package com.zcc.arthastest;

import com.zcc.arthastest.domain.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zcc
 */
@RestController
public class TestController {

    @RequestMapping(value = "/get", method = RequestMethod.GET)
    public User getUser(Long id) throws InterruptedException {
        if (id < 1){
            throw new RuntimeException("参数错误");
        }
        Thread.sleep(3000);
        User user = new User();
        user.setId(id);
        user.setName("name" + id);
        return user;
    }

}
